# -*- coding: utf-8 -*-
# @Time : 2024/5/28 16:02
# @Author : ZH
# @File : 2951.py
# @Software: PyCharm
from typing import List


class Solution:
    def findPeaks(self, mountain: List[int]) -> List[int]:
        if len(mountain) < 3: return []
        if len(mountain) == 3: return [1] if mountain[0] < mountain[1] > mountain[2] else []
        end_data = []
        n = len(mountain)
        index = 1
        while 1 <= index <= n-2:
            if mountain[index - 1] < mountain[index] > mountain[index + 1]:
                end_data.append(index)
                index += 1
            index += 1
        return end_data
